package com.yanjiali.feign;

import com.yanjiali.config.feign.OAuth2FeignConfig;
import com.yanjiali.model.R;
import com.yanjiali.model.resp.GetTheBasicInformationOfTheUserByIDResp;
import com.yanjiali.model.resp.GetTheBasicInformationOfTheUserByIDsResp;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import com.yanjiali.model.resp.ObtainTheUsernameThroughTheIdResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Package: controller
 * @Author: yanjiali
 * @Created: 2025/4/18 22:12
 */
@FeignClient(name = "user-service", path = "/v1/users", configuration = OAuth2FeignConfig.class)
public interface UserServiceFeign {

    @GetMapping("/getByIdUsername")
    @ApiOperation("通过用户id获取用户名")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "普通用户id")
    })
    R<ObtainTheUsernameThroughTheIdResp> obtainTheUsernameThroughTheId(@RequestParam Long userId);

    @GetMapping("/getByIdUserInfo")
    @ApiOperation("通过用户id获取用户基本信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "普通用户id")
    })
    R<GetTheBasicInformationOfTheUserByIDResp> getTheBasicInformationOfTheUserByID(@RequestParam Long userId);

    @GetMapping("/getByIdUserInfoList")
    @ApiOperation("通过用户id获取用户基本信息，批量获取")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userIds", value = "普通用户id集合")
    })
    R<GetTheBasicInformationOfTheUserByIDsResp> getTheBasicInformationOfTheUserByIDs(@RequestParam List<Long> userIds);
}